
let self
var app = getApp();
const { FILTERS } = require('../../config/filters.js');
Page({
	data: {
		filters: [],
		currentFilter: [],  // 当前选择的筛选
		channelName: '',  // 通过哪种方式进入筛选列表页 地区筛选或专业筛选
	},
  /**
   * 生命周期函数--监听页面加载
   */
	onLoad: function (options) {
		self = this;

		wx.setNavigationBarTitle({
			title: options.title || '在职研'
		})
		let filters = FILTERS[options.filters] || FILTERS['academy']
		self.setData({
			filters: filters.data,
			title: options.title || '在职研',
			channelName: options.filters
		})
	},

  /**
   * 生命周期函数--监听页面显示
   */
	onShow: function (e) {
		self.data.currentFilter || slef.setData({ currentFilter: [0] })
		console.log(self.data.currentFilter) // 获取列表数据
	},
	onMenuDown(e) {
		console.log(e)
	},
	onCurrent(e) {
		wx.showLoading({
			title: '加载中...',
		})
		setTimeout(function () {
			wx.hideLoading()
		}, 1000)
		let category = [];
		for (let k in e.detail) {
			category.push(e.detail[k])
		}
		self.setData({
			currentFilter: category
		})
	},


  /**
   * 用户点击右上角分享
   */
	onShareAppMessage: function () {

	}
})